// 统计相关 api（同步自老项目 statistics.js）
import http from '@/utils/http'

const apiFormData = {
    // 营业账单
    deskOrderList: 'deskOrder/list',
    // 反结账列表
    deskOrderCancelList: 'deskOrder/cancelList',
    // 营业账单的订单反结账
    deskOrderCancel: 'deskOrder/orderCancel',
    // 挂账账单列表
    creditLogList: 'CreditLog/list',
    // 重新打印小票
    printOrderReprint: 'ticket/reprint',
    // 反回款
    logPayCancel: 'creditRepaymentOrder/LogPayCancel',
    // 回款订单进入结算状态，查询回款订单支付信息（老项目对齐）
    creditRepaymentOrderInfo: 'creditRepaymentOrder/orderPayment',
    // 将挂账历史绑定到当前订单（老项目对齐）
    creditOrderBindLog: 'creditRepaymentOrder/orderBindLog',
    // 解绑挂账（老项目对齐）
    orderUnBindLog: 'creditRepaymentOrder/orderUnBindLog',
    // 新增子账户
    creditAddAccount: 'credit/addAccount',
    // 修改子账户
    creditEditAccount: 'credit/editAccount',
    // 删除子账户
    creditDelAccount: 'credit/delAccount',
    // 回款明细订单
    creditRepaymentOrderDetail: 'CreditRepaymentOrder/ticket',
    // 查询回款明细小票(详情)
    creditRepaymentOrderList: 'creditRepaymentOrder/list',

    ticketDetail: 'deskOrder/ticketDetail',
    // 菜品分类报表
    foodCategoryReport: 'foodCategory/report',
    // 取消支付订单
    payMoneyOrderCancel: 'cashier/orderCancel',
}

export function deskOrderList(data: any) {
    return http({ url: apiFormData.deskOrderList, method: 'post', data })
}

export function deskOrderCancelList(data: any) {
    return http({ url: apiFormData.deskOrderCancelList, method: 'post', data })
}

export function deskOrderCancel(data: any) {
    return http({ url: apiFormData.deskOrderCancel, method: 'post', data })
}

export function creditLogList(data: any) {
    return http({ url: apiFormData.creditLogList, method: 'post', data })
}

export function printOrderReprint(data: any) {
    return http({ url: apiFormData.printOrderReprint, method: 'post', data })
}

export function logPayCancel(data: any) {
    return http({ url: apiFormData.logPayCancel, method: 'post', data })
}

// 回款订单进入结算状态，查询回款订单支付信息
export function creditRepaymentOrderInfo(data: any) {
    return http({ url: apiFormData.creditRepaymentOrderInfo, method: 'post', data })
}

// 将挂账历史绑定到当前订单
export function creditOrderBindLog(data: any) {
    return http({ url: apiFormData.creditOrderBindLog, method: 'post', data })
}

// 解绑挂账
export function orderUnBindLog(data: any) {
    return http({ url: apiFormData.orderUnBindLog, method: 'post', data })
}

export function creditAddAccount(data) {
    return http({ url: apiFormData.creditAddAccount, method: 'post', data })
}

export function creditEditAccount(data) {
    return http({ url: apiFormData.creditEditAccount, method: 'post', data })
}

export function creditDelAccount(data) {
    return http({ url: apiFormData.creditDelAccount, method: 'post', data })
}

export function creditRepaymentOrderDetail(data: any) {
    return http({ url: apiFormData.creditRepaymentOrderDetail, method: 'post', data })
}

export function creditRepaymentOrderList(data: any) {
    return http({ url: apiFormData.creditRepaymentOrderList, method: 'post', data })
}

export function ticketDetail(data: any) {
    return http({ url: apiFormData.ticketDetail, method: 'post', data })
}

export function foodCategoryReport(data: any) {
    return http({ url: apiFormData.foodCategoryReport, method: 'post', data })
}

export function payMoneyOrderCancel(data: any) {
    return http({ url: apiFormData.payMoneyOrderCancel, method: 'post', data })
}
